<?php
header('Content-type: text/vnd.wap.wml');
echo '<?xml version="1.0" encoding="utf-8"?>'."\n";
$title 		= $_REQUEST['title'];
$content 	= $_REQUEST['content'];
?>
<!DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="Đăng ghi chú">
<p>
<?php
	if ($db = new SQLite3('webnote.db3')) 
	{
		$q = $db->exec("INSERT INTO notes ( title , content ) VALUES ( '".$db->escapeString($title)."', '".$db->escapeString($content)."' )");
		if($q === false)
			die("Couldn't insert into table: ".$db->lastErrorMsg());
		else
		{
			echo "Insert successful\n";
?>
	<b>Tiêu đề</b>:  <?php echo $title ?><br />
	<b>Nội dung</b>: <?php echo $content ?><br />
<?php
		}
	}
	else
		die("Couldn't open database!");
?>
<a href="addnote.wml">Đăng ghi chú khác</a><br/>
<a href="viewnote.php">Xem lại các ghi chú của bạn:</a>
<br/> <br/>
	&#169;2011 -  Vutrankien - vukien@hcm.fpt.vn<br/>  
</p>
</card>
</wml>